﻿using System;
using System.Collections.Generic;

namespace MuZa.MuZa
{
    internal class Participant
    {
        private String Id;
        private String Location;
        private String Name;

        private List<Resource> Resources = new List<Resource>();

        /**
         * 
         */

        public Participant()
        {
        }


        public Participant(String Id, String Name, String Location)
        {
            this.Id = Id;
            this.Name = Name;
            this.Location = Location;
        }

        /**
         * 
         * @return
         */

        public String getId()
        {
            return Id;
        }

        /**
         * 
         * @param Id
         */

        public void setId(String Id)
        {
            this.Id = Id;
        }

        /**
         * 
         * @return
         */

        public String getLocation()
        {
            return Location;
        }

        /**
         * 
         * @param Location
         */

        public void setLocation(String Location)
        {
            this.Location = Location;
        }

        /**
         * 
         * @return
         */

        public String getName()
        {
            return Name;
        }

        /**
         * 
         * @param Name
         */

        public void setName(String Name)
        {
            this.Name = Name;
        }

        /**
         * 
         * @return
         */

        public List<Resource> getResources()
        {
            return Resources;
        }

        /**
         * 
         * @param Resources
         */

        public void setResources(List<Resource> Resources)
        {
            this.Resources = Resources;
        }

        /**
         * 
         */

        public void addResourceToList(Resource res)
        {
            Resources.Add(res);
        }

        /**
         * Participant process the request getted from initiator
         */

        public void processRequest()
        {
            //get init req
            //send IB NoR update
            //check the resource amount
            //if satisfying
            //  stor the init info
            //  send agree to init 
            //  send IB Res_quantity update
            //  part Res_quantity update
            //else
            // send refuse to init
        }
    }
}